<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        img {
            position: absolute;
            top: 2px;
        }
    </style>
</head>

<body>
    <img src="images/1.png" alt="">

    <script>
        /* 
            需求：只用指定的图片作为鼠标的指针
         */

        const imgObj = document.querySelector("img")
        document.addEventListener("mousemove", function (e) {
            //  console.log(e.pageX)
            //  console.log(e.pageY)


            const x = e.pageX;
            const y = e.pageY;
            imgObj.style.left = x - 30 + 'px';
            imgObj.style.top = y - 32 + 'px';
        })
    </script>
</body>

</html>